<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
selection_test(
    [
        '<div contenteditable>',
            '<b><p>foo^</p><p>|bar</p></b></div>',
        '</div>',
    ],
    'delete',
    [
        '<div contenteditable>',
            '<b><p>foo|',
            'bar',
            '</p></b>',
        '</div>',
    ],
    'Merge multiple paragraphs with enclosing bold element');

selection_test(
    [
        '<div contenteditable>',
            '<i><p>foo^</p><p>|bar</p></i></div>',
        '</div>',
    ],
    'delete',
    [
        '<div contenteditable>',
            '<i><p>foo|',
            'bar',
            '</p></i>',
        '</div>',
    ],
    'Merge multiple paragraphs with enclosing italics element');

selection_test(
    [
        '<div contenteditable>',
            '<u><p>foo^</p><p>|bar</p></u></div>',
        '</div>',
    ],
    'delete',
    [
        '<div contenteditable>',
            '<u><p>foo|',
            'bar',
            '</p></u>',
        '</div>',
    ],
    'Merge multiple paragraphs with enclosing underline element');

selection_test(
    [
        '<div contenteditable>',
            '<b><i><p>foo^</p><p>|bar</p></i></b></div>',
        '</div>',
    ],
    'delete',
    [
        '<div contenteditable>',
            '<b><i><p>foo|',
            'bar',
            '</p></i></b>',
        '</div>',
    ],
    'Merge multiple paragraphs with multiple enclosing presentational element');
</script>